package com.zyx.flowable.controller;

import com.zyx.flowable.domain.dto.FlowDeployProcDto;
import com.zyx.flowable.domain.vo.FlowDeployProcVO;
import com.zyx.flowable.service.IFlowDefinitionService;
import com.zyx.wanshu.util.PageUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * <p>流程定义的Controller</p>
 * <p>&emsp;&emsp;流程定义查询</p>
 * <p>&emsp;&emsp;流程部署</p>
 * <p>&emsp;&emsp;删除流程</p>
 * <p>&emsp;&emsp;挂起/激活流程</p>
 * <p>&emsp;&emsp;查看流程图</p>
 *
 * @author Yaxi.Zhang
 * @since 2022/8/24 00:51
 */
@Slf4j
@Controller
@RequestMapping("/flow/definition")
public class FlowDefinitionController {
    @Autowired
    private IFlowDefinitionService flowDefinitionService;

    /**
     * 查询流程定义
     */
    @GetMapping("/list")
    public String list(FlowDeployProcVO pageVo, Model model) {
        pageVo = flowDefinitionService.list(pageVo);
        model.addAttribute("pageUtils", pageVo);
        return "flow/definition/flowDefinition";
    }

}
